package com.sshiro.bean;

import java.util.Map.Entry;
import java.util.Properties;

import org.springframework.beans.factory.config.PropertyPlaceholderConfigurer;

public class PropertyPlaceholderConfigurerExt extends
		PropertyPlaceholderConfigurer {

	@Override
	protected void convertProperties(Properties props) {
		for (Entry<Object, Object> entry : props.entrySet()) {
			String value = String.valueOf(entry.getValue());
			logger.info("value:" + value);
			
			// 参数加密标识
			// if (value.startsWith("$KEY") || value.startsWith("$key")) {
			// value = DBUtils.Decrypt(value.substring(4), DBUtils.DEFUALT_KEY);
			// }
			props.put(String.valueOf(entry.getKey()), value);
		}
		super.convertProperties(props);
	}
}
